package com.pearl.security.multiloginreject.demo.session.redis;

import org.springframework.session.Session;
import org.springframework.session.SessionRepository;

import java.util.Map;

/**
 * @author TD
 * @version 1.0
 * @date 2024/5/15
 */
public interface MyFindByIndexNameSessionRepository<S extends Session> extends SessionRepository<S> {
    String PRINCIPAL_NAME_INDEX_NAME = org.springframework.session.FindByIndexNameSessionRepository.class.getName().concat(".PRINCIPAL_NAME_INDEX_NAME");

    Map<String, S> findByIndexNameAndIndexValue(String var1, Object principal);

    default Map<String, S> findByPrincipalName(Object principal) {
        return this.findByIndexNameAndIndexValue(PRINCIPAL_NAME_INDEX_NAME, principal);
    }
}
